Skip to content

Introduce an optional configurable request timeout - #540

Closed
howard wants to merge 1 commit into
getsentry:masterfrom
findologic:optional_request_timeout
Closed

howard wants to merge 1 commit into
getsentry:masterfrom
findologic:optional_request_timeout

Conversation

@howard

@howard howard commented Mar 25, 2016

Copy link
Copy Markdown

By default, XMLHttpRequests do not time out. A developer might want to react to
errors by redirecting to an error page, which was only possible by listening
for ravenSuccess and ravenFailure events.

In case of network issues or Sentry being overloaded, error reporting requests
may take a very long time. The newly introduced ravenTimeout event is triggered
once a user-defined timeout has aborted the request.

By default, XMLHttpRequests do not time out. A developer might want to react to
errors by redirecting to an error page, which was only possible by listening
for ravenSuccess and ravenFailure events.

In case of network issues or Sentry being overloaded, error reporting requests
may take a very long time. The newly introduced ravenTimeout event is triggered
once a user-defined timeout has aborted the request.
@georgms

georgms commented Mar 25, 2016

Copy link
Copy Markdown

👍

@howard

howard commented Mar 30, 2016

Copy link
Copy Markdown
Author

We've started using Raven.js with this change in production. So far, we haven't found any problems with thousands of users having come in contact with it.

Comment thread src/raven.js
typeof XDomainRequest !== 'undefined';

return (hasCORS ? this._makeXhrRequest : this._makeImageRequest)(opts);
return (hasCORS ? this._makeXhrRequest : this._makeImageRequest).call(this, opts);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops

@benvinegar

Copy link
Copy Markdown
Contributor

@howard – Hey, thanks for submitting this. My only comment is that I'm retiring the current DOM-based event system, which is undocumented, for the event system described in #524 (and implemented in #521). This event system will get rolled out in Raven 3.0. I'd rather keep it undocumented until that time.

@jamiecounsell

Copy link
Copy Markdown

Is it possible to look into merging this? Upgrading to 3.0 may take some time, especially for some of the projects I and others are relying on Raven for. My current approach will be to use a static copy of raven.js with the change included here, but I would like to be able to rely on the package. Thanks for the consideration! Happy to discuss or contribute if it helps.

@benvinegar

benvinegar commented Oct 19, 2016 •

Copy link
Copy Markdown
Contributor

@jamiecounsell – the blocker here is the new timeout event introduced in this patch. If the timeout state triggered the existing ravenFailure event instead, then I can modify this PR and merge it.

I don't want to introduce new events because the existing events are not usable by React Native, and the API will definitely change.

@jamiecounsell

Copy link
Copy Markdown

@benvinegar thanks for the prompt response. I will look into this!

@kamilogorek

Copy link
Copy Markdown
Contributor

This PR is outdated, therefore I'll close it for now. @howard @jamiecounsell, if you'd like to work on updating it, please let me know. I created #1033 to track this feature.

pull Bot pushed a commit to TheDegenerateDev5150/sentry-javascript that referenced this pull request Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants